import React, { Component } from 'react'
import { Button } from 'antd'
import { useDispatch, connect, useHistory } from 'umi'
// import { connect } from 'react-redux'


const Login = (props:any) => {
  const dispatch = useDispatch();
  const history = useHistory();
  const { goodsList  } = props;

  return <div>
    <Button onClick={() => {
      (dispatch as any)({
        type: 'goods/getGoods',
        data: {page: 1, size: 5}
      }).then((res:any) => {
        history.push(`/web/home`)
      })
    }}>点击</Button>
  </div>
}

export default connect(state => {
  return {...state}
})(Login);


// export default class index extends Component {
//   render() {
//     return (
//       <div>
//         <Button onClick={() => {

//         }}>点击</Button>
//         Login
//       </div>
//     )
//   }
// }
